package com.echo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 考试题目表
 * </p>
 *
 * @author echo
 * @since 2024-10-31
 */
@Data
@TableName("question")
public class Question implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 题目的主键
     */
    @TableId(value = "question_id", type = IdType.AUTO)
    private String questionId;

    /**
     * 题目的名字
     */
    private String questionName;

    /**
     * 题目的分数
     */
    private Integer questionScore;

    /**
     * 题目创建者的用户id
     */
    private String questionCreatorId;

    /**
     * 题目难易度级别
     */
    private Integer questionLevelId;

    /**
     * 题目的类型，比如单选、多选、判断等
     */
    private Integer questionTypeId;

    /**
     * 题目的类型，比如数学、英语、政治等
     */
    private Integer questionCategoryId;

    /**
     * 题目额外的描述
     */
    private String questionDescription;

    /**
     * 题目的选项，用选项的id用-连在一起表示答案
     */
    private String questionOptionIds;

    /**
     * 题目的答案，用选项的id用-连在一起表示答案
     */
    private String questionAnswerOptionIds;

    /**
     * 创建时间, 设计表时设置了自动插入当前时间，无需在Java代码中设置了
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新时间，设计表时设置了自动插入当前时间，无需在Java代码中设置了。
     * 同时@DynamicUpdate注解可以时间当数据库数据变化时自动更新，无需人工维护
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;



    @Override
    public String toString() {
        return "Question{" +
            "questionId=" + questionId +
            ", questionName=" + questionName +
            ", questionScore=" + questionScore +
            ", questionCreatorId=" + questionCreatorId +
            ", questionLevelId=" + questionLevelId +
            ", questionTypeId=" + questionTypeId +
            ", questionCategoryId=" + questionCategoryId +
            ", questionDescription=" + questionDescription +
            ", questionOptionIds=" + questionOptionIds +
            ", questionAnswerOptionIds=" + questionAnswerOptionIds +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
